package rpc.loadbalance;

import rpc.common.MyURL;

import java.util.List;
import java.util.Random;

/**
 * 自定义负载均衡
 */
public class MyLoadBalance {
    /**
     * 随机算法
     */
    public static MyURL random(List<MyURL> myURLs) {
        Random random = new Random();
        int i = random.nextInt(myURLs.size());
        return myURLs.get(i);
    }
}
